<?php
	$macropage="criminal.php";
	include "globals.php";
	
	if($ir['jail'] or $ir['hospital']) {
		die("This page cannot be accessed while in jail or hospital.");
	}

	$q2=$db->query("SELECT * FROM crimes ORDER BY crimeBRAVE ASC");
	while ($r2=$db->fetch_row($q2)){
		$crimes[]=$r2;
	}

	$q=$db->query("SELECT * FROM crimegroups ORDER by cgORDER ASC");
	print "<b>Criminal Centre</b><br />
<table width='75%' cellspacing=1 class='table'><tr><th>Crime</th><th>Cost</th><th>Do</th></tr>";
	while($r=$db->fetch_row($q)){
		print "<tr><td colspan='3' class='h'>{$r['cgNAME']}

	</td></tr>";
	foreach($crimes as $v){
		
		if($v['crimeGROUP'] == $r['cgID']){
			print "<tr><td>{$v['crimeNAME']}

		</td><td>{$v['crimeBRAVE']}

	 Brave</td><td><a href='docrime.php?c={$v['crimeID']}

'>Do</a></td></tr>";
}

}

}

print "</table>";
$h->endpage();
?>